I need an alternative to $nin in mongodb. As we know, we can achieve the "IN" query operation by performing "OR" query as well.
In the same way, how can I achieve "NOT IN" functionality in mongodb without using $nin ? What are the alternatives to using $nin in mongodb to acheive exactly same results ?
Well, interesting, But I think It can be achieved by $not
say you have $nin for A,B and C where A,B, C are values which you want to ignore
so instead of calling $nin : [ABC]
what if we call $not : {$or : [A,B,C]}
Update :
Since $not is not working with $or. Maybe you can try $nor which I hope is basically same concept.
I found that there is a operator $nor which exactly does this function. It works as the negation of $or.